:root {
    --primary-color: #4361ee;
    --secondary-color: #3a0ca3;
    --accent-color: #7209b7;
    --light-color: #f8f9fa;
    --dark-color: #2b2d42;
    --error-color: #d62246;
    --success-color: #4cc9f0;
    --neutral-color: #e9ecef;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f0f2f5;
    background-image: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
    min-height: 100vh;
}

.container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(5px);
    transition: transform 0.3s ease;
}

.container:hover {
    transform: translateY(-5px);
}

header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

header h1 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 2.5rem;
    letter-spacing: -0.5px;
    font-weight: 700;
}

header p {
    color: #666;
    font-size: 1.1rem;
}

.tabs {
    display: flex;
    margin-bottom: 2rem;
    background-color: var(--neutral-color);
    border-radius: 12px;
    padding: 0.5rem;
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.tab-btn {
    flex: 1;
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: #666;
    border-radius: 8px;
    transition: all 0.3s ease;
    z-index: 1;
    position: relative;
    text-align: center;
}

.tab-btn.active {
    color: white;
}

.tabs::before {
    content: '';
    position: absolute;
    width: 50%;
    height: calc(100% - 1rem);
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    top: 0.5rem;
    left: 0.5rem;
    border-radius: 8px;
    transition: transform 0.3s ease;
    z-index: 0;
}

.tabs .tab-btn:nth-child(2).active ~ .tabs::before {
    transform: translateX(100%);
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.upload-form {
    background-color: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.upload-form:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.file-upload {
    margin-bottom: 1.5rem;
}

.file-upload input[type="file"] {
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    position: absolute;
    z-index: -1;
}

.file-upload label {
    display: block;
    padding: 1.5rem;
    text-align: center;
    background-color: #f8f9fa;
    border: 2px dashed #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    color: #666;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.file-upload label::before {
    content: '📄';
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

.file-upload label:hover {
    background-color: #eef2ff;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.submit-btn {
    display: block;
    width: 100%;
    padding: 1rem;
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.results {
    background-color: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.results:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.results h2 {
    color: var(--dark-color);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.results h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 50px;
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    border-radius: 3px;
}

/* Progress bar styles */
.progress-container {
    margin-top: 15px;
    width: 100%;
    background-color: var(--neutral-color);
    border-radius: 8px;
    overflow: hidden;
    height: 20px;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    border-radius: 8px;
    transition: width 0.3s ease;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--dark-color);
    font-size: 0.8rem;
    font-weight: 500;
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.5);
}

/* Optimized word list layout */
#word-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.8rem;
}

#word-list li {
    background: linear-gradient(to right, var(--accent-color), var(--primary-color));
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 30px;
    font-size: 0.95rem;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

#word-list li:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.15);
}

.loading-spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border-left-color: var(--primary-color);
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.hidden {
    display: none;
}

#audio-player {
    width: 100%;
}

audio {
    width: 100%;
    margin-bottom: 1.5rem;
    border-radius: 12px;
    background-color: #f5f7fa;
}

.download-btn {
    display: inline-block;
    padding: 0.8rem 1.8rem;
    background: linear-gradient(to right, var(--accent-color), var(--primary-color));
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

footer {
    margin-top: 3rem;
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    color: #666;
    font-size: 0.9rem;
}

footer p {
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

footer p:hover {
    opacity: 1;
}

footer i {
    color: var(--accent-color);
    margin-right: 0.3rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding: 1.5rem;
        margin: 1rem;
        border-radius: 12px;
    }
    
    .upload-form, .results {
        padding: 1.5rem;
    }
    
    header h1 {
        font-size: 2rem;
    }
}

/* Tabs Indicator */
.tab-indicator {
    position: absolute;
    height: calc(100% - 1rem);
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    top: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
    z-index: 0;
}

/* File upload animation */
.file-upload label.file-selected {
    animation: pulse 0.5s ease;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Notification system */
#notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 300px;
}

.notification {
    background-color: white;
    color: #333;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification i {
    margin-right: 10px;
    font-size: 1.2rem;
}

.notification.success {
    border-left: 4px solid var(--success-color);
}

.notification.success i {
    color: var(--success-color);
}

.notification.error {
    border-left: 4px solid var(--error-color);
}

.notification.error i {
    color: var(--error-color);
}

.notification.info {
    border-left: 4px solid var(--primary-color);
}

.notification.info i {
    color: var(--primary-color);
}

/* Results header with action button */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.results-header h2 {
    margin-bottom: 0;
}

.action-btn {
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.action-btn i {
    font-size: 0.9rem;
}

/* 用户系统样式 */
.auth-container {
    max-width: 600px;
}

.auth-form-container {
    background-color: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}

.auth-form {
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark-color);
}

.form-group input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid var(--neutral-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
    outline: none;
}

.auth-btn {
    display: block;
    width: 100%;
    padding: 1rem;
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.auth-links {
    text-align: center;
    font-size: 0.9rem;
}

.auth-links p {
    margin: 0.8rem 0;
}

.auth-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.auth-links a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

.flash-message {
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    animation: fadeIn 0.5s ease;
}

.flash-message i {
    margin-right: 0.8rem;
    font-size: 1.2rem;
}

.flash-message.error {
    background-color: rgba(214, 34, 70, 0.1);
    color: var(--error-color);
    border-left: 4px solid var(--error-color);
}

.flash-message.success {
    background-color: rgba(76, 201, 240, 0.1);
    color: var(--success-color);
    border-left: 4px solid var(--success-color);
}

.flash-message.info {
    background-color: rgba(67, 97, 238, 0.1);
    color: var(--primary-color);
    border-left: 4px solid var(--primary-color);
}

/* 仪表盘样式 */
.dashboard-container {
    max-width: 1100px;
}

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.dashboard-header .logo h1 {
    margin-bottom: 0;
    font-size: 2rem;
}

.user-nav {
    display: flex;
    align-items: center;
}

.username {
    font-weight: 600;
    margin-right: 1.5rem;
    color: var(--dark-color);
}

.logout-btn {
    padding: 0.5rem 1rem;
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--dark-color);
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

.logout-btn:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.dashboard-nav {
    display: flex;
    margin-bottom: 2rem;
    background-color: var(--neutral-color);
    border-radius: 12px;
    overflow: hidden;
}

.dashboard-nav-item {
    flex: 1;
    padding: 1rem;
    text-align: center;
    text-decoration: none;
    color: var(--dark-color);
    font-weight: 600;
    transition: all 0.3s ease;
}

.dashboard-nav-item.active {
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    color: white;
}

.dashboard-nav-item:hover:not(.active) {
    background-color: rgba(0, 0, 0, 0.05);
}

.vocabulary-section {
    background-color: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--dark-color);
}

.vocabulary-actions {
    display: flex;
    align-items: center;
}

.word-count {
    margin-right: 1rem;
    padding: 0.4rem 0.8rem;
    background-color: rgba(67, 97, 238, 0.1);
    color: var(--primary-color);
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 600;
}

.word-grid {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.word-grid li {
    background: linear-gradient(to right, var(--accent-color), var(--primary-color));
    color: white;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    text-align: center;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.word-grid li:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.15);
}

.empty-state {
    text-align: center;
    padding: 3rem 0;
    color: #666;
}

.empty-state i {
    font-size: 3rem;
    color: var(--neutral-color);
    margin-bottom: 1rem;
}

.empty-state p {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.empty-state .empty-state-desc {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    opacity: 0.7;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        text-align: center;
    }
    
    .dashboard-header .logo {
        margin-bottom: 1rem;
    }
    
    .section-header {
        flex-direction: column;
        text-align: center;
    }
    
    .vocabulary-actions {
        margin-top: 1rem;
    }
    
    .word-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

.success-message {
    background: linear-gradient(to right, var(--success-color), #3ac4f4) !important;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    font-weight: 600;
    text-align: center;
    border-radius: 8px;
    padding: 1rem !important;
    box-shadow: 0 3px 10px rgba(76, 201, 240, 0.3) !important;
}

.success-message i {
    font-size: 1.1rem;
}

#add-to-vocab-btn {
    margin-left: 0.5rem;
    background: linear-gradient(to right, var(--success-color), #3ac4f4);
}

#add-to-vocab-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(76, 201, 240, 0.3);
}

#add-to-vocab-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* 首页用户导航 */
.auth-nav {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
    gap: 1rem;
}

.auth-link, .user-link, .logout-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.auth-link {
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
    color: white;
}

.auth-link.register {
    background: rgba(114, 9, 183, 0.1);
    color: var(--accent-color);
}

.auth-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.user-link {
    background: rgba(67, 97, 238, 0.1);
    color: var(--primary-color);
}

.logout-link {
    background: rgba(214, 34, 70, 0.1);
    color: var(--error-color);
}

.user-link:hover, .logout-link:hover {
    transform: translateY(-2px);
}

/* Audio Files List */
.audio-files-list {
    margin-top: 20px;
    border-top: 1px solid #eaeaea;
    padding-top: 15px;
}

.audio-files-list h3 {
    margin-bottom: 15px;
    color: #444;
    display: flex;
    align-items: center;
    font-size: 1.1rem;
}

.audio-files-list h3 i {
    margin-right: 8px;
    color: #4a69bd;
}

.audio-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    margin-bottom: 8px;
    background-color: #f9f9f9;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.audio-item:hover {
    background-color: #f1f1f1;
}

.audio-name {
    flex-grow: 1;
    font-size: 0.95rem;
    color: #333;
    margin-right: 15px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.audio-controls {
    display: flex;
    align-items: center;
}

.play-btn {
    background-color: #4a69bd;
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.play-btn:hover {
    background-color: #3c5ea9;
}

.download-btn {
    background-color: #6ab04c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
    text-decoration: none;
}

.download-btn:hover {
    background-color: #5a9840;
}

/* Update the Audio Player */
#audio-player {
    margin-top: 20px;
    text-align: center;
    transition: opacity 0.5s ease;
}

#audio-player audio {
    width: 100%;
    margin-bottom: 10px;
    border-radius: 8px;
    outline: none;
}

/* 播放中的音频项高亮 */
.audio-item.playing {
    background: linear-gradient(to right, rgba(74, 105, 189, 0.15), rgba(74, 105, 189, 0.05));
    border-left: 3px solid #4a69bd;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.audio-item.playing .audio-name {
    font-weight: 600;
    color: #4a69bd;
}

/* 调整音频播放器样式 */
#audio-player .audio-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

#audio-player .audio-controls .action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(to right, #4a69bd, #3a4e8c);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

#audio-player .audio-controls .action-btn:hover {
    background: linear-gradient(to right, #3a4e8c, #2d3d6e);
    transform: translateY(-2px);
}

#audio-player .audio-controls .download-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(to right, #6ab04c, #5a9840);
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

#audio-player .audio-controls .download-btn:hover {
    background: linear-gradient(to right, #5a9840, #4a8735);
    transform: translateY(-2px);
}

#audio-player audio {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 0;
} 